-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[이형준]sprint10 #295
The head ref may contain hidden characters: "Next-\uC774\uD615\uC900-sprint10"
[이형준]sprint10 #295
Conversation
- isLogin이 localStorage값을 참조해서 ssr에서 사용 불가능 해서 state로 만듦
- 이미지 전송 로직 수정 - title이 길어지는 경우 대응
- 경과된 시간을 string 값으로 return 해주는 함수
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
과제하느라 고생하셨습니다! 에러 핸들링에 많이 신경써주신 것 같네요 👍
|
||
export type OrderOption = "like" | "recent"; | ||
|
||
interface GetArticlesProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 타입이 api 요청을 보낼때 매개변수 타입으로 쓰인다면, GetArticlesParams 같은 이름도 추천드립니다.
password: string; | ||
} | ||
|
||
export interface SignUpUserProps extends LogInUserProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extends 활용하신거 좋네요~
localStorage.setItem("access_token", accessToken); | ||
localStorage.setItem("refresh_token", refreshToken); | ||
window.location.href = "/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api 요청을 보내는 부분에서는 api 요청만 보내고 이런 로직들은 훅으로 만들어서 api 호출할때 추가해주시는 것을 추천드립니다. 각 함수의 역할을 분리해주는 것이죠!
axiosInstance.interceptors.request.use(onRequest); | ||
axiosInstance.interceptors.response.use((response: AxiosResponse) => response, onErrorResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interceptor 활용 잘해주셨네요!
const path = router.pathname; | ||
export default function GlobalNavBar() { | ||
const { pathname } = useRouter(); | ||
const isMain = pathname === "/" ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 변수는 const isMain = pathname === "/"
로 줄일 수 있을 것 같습니다.
|
||
onChangeComments((prevComments) => [postedComment, ...prevComments]); | ||
} catch (error) { | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error 로그를 찍을때, console.error 사용도 추천드립니다.
if (id === null) { | ||
throw new Error("id 값이 올바르지 않습니다."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
직접 에러 던져주신거 좋네요!
사이트 배포 링크
요구사항
피그마 링크
기본 요구사항
체크리스트 (기본)
상품 등록 페이지
상품 상세 페이지
피드백 반영
추가 예정 사항
주요 변경사항
멘토에게